package com.devilvan.mock;

import com.alibaba.fastjson.JSON;
import com.devilvan.jsoup.Author;
import org.junit.Test;

import java.util.Date;

public class MoctTest {
    @Test
    public void testMock() throws Exception{
    }

    @Test
    public void serde(){
        Author author = new Author();
        author.setCreateTime(new Date());
        System.out.println(author.getCreateTime());
        String jsonString = JSON.toJSONString(author);
        System.out.println(jsonString);
        String s = "{\"createTime\":\"2022-03-22 15:20:13\"}";
        Author author1 = JSON.parseObject(s, Author.class);
        System.out.println(author1.getCreateTime());
    }
}
